package cn.wolfcode.handler;

import cn.wolfcode.domain.OrderInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Component
@CanalTable(value = "t_order_info")
public class OrderInfohandler implements EntryHandler<OrderInfo> {
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Override
    public void insert( OrderInfo orderInfo) {
        // 设置Redis中存储该场次商品已经被购买的用户id
        // 在订单插入mysql完毕之后,再插入redis中

    }

    @Override
    public void update(OrderInfo before, OrderInfo after) {
        System.out.println("修改前的数据:" + before);
        System.out.println("修改后的数据:" + after);
    }

    @Override
    public void delete(OrderInfo orderInfo) {
    }
}
